/*
 * @Date: 2023-12-04 16:17:01
 * @LastEditors: 玄绮 shijiahansi@qq.com
 * @LastEditTime: 2024-03-16 22:59:48
 * @FilePath: \client\src\Application.h
 */
#ifndef APPLICATION_H
#define APPLICATION_H

#pragma once
#include <Client.h>
#include <QApplication>
#include <QMap>
#include <QTcpSocket>
#include <QThread>
#include <mainwindow/mainwindow.h>
// #include <packet/Packet.h>
// #include <packet/file/FilePacket.h>
// #include <packet/message/Message.h>
// #include <packet/request/Request.h>
// #include <packet/response/Response.h>
// #include <tools/uploadfile/UploadFileThread.h>
// #include <tools/uploadfile/uploadfileform.h>

class UploadFileThread;
class Application : public Client {
    Q_OBJECT
private:
    static Application* m_app;
    friend int          main(int argc, char* argv[]);  // 只有 main 函数才能创建 App

    Application();

public:
    ~Application();

public:
    void onTryConnect();

public:
    static Application*                          instance();
    static const data::UserInfo&                 Myself();

private:
    MainWindow* mainwindow = nullptr;

    bool isConnected = false;
};

#endif